package com.twu.biblioteca;

public class Book {

    private boolean available;
    private final String name;
    private final String author;

    public Book(String name, String author, boolean available) {
        this.name = name;
        this.author = author;
        this.available = available;
    }

    public boolean ifBookIsAvailable(){
        return this.available;
    }

    public void changeBookStatus() {
        this.available = !available;
    }

    @Override
    public String toString() {
        String isAvailable = this.available? "Available":"Unavailable";
        return "Name: " + this.name + " | Author: " + this.author + " | Status: " + isAvailable;
    }
}
